home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / cbibcode.arc / _CHMOD2.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-05  |  438 b   |  19 lines

  1. /* _chmod2.c --- p 574 */
  2. #include <stdio.h>
  3. #include <dos.h>
  4. main()
  5. {
  6.     int attribute;
  7.     char filename[80], *p_fname;
  8.     printf("Enter filename: ");
  9.     p_fname = gets(filename);
  10.     if((attribute = _chmod(p_fname, 0)) == -1)
  11.     {
  12.         printf("Error in _chmod call!\n");
  13.         exit(0);
  14.     }
  15.     if ((attribute & FA_DIREC) == FA_DIREC)
  16.         printf("%s is a subdirectory. \n", filename);
  17.     else
  18.         printf("%s is NOT a subdirectory. \n", filename);
  19. }